package com.gxa.mapper.activities;

import com.gxa.pojo.Activity;
import com.gxa.pojo.ActivityContent;
import org.apache.ibatis.annotations.Param;

import java.util.List;
public interface ActivitiesMapper {
    /*
    查询活动
     */
    List<Activity> selectActivity(@Param(value = "pageSize") int pageSize,
                                  @Param(value = "index") int index,
                                  @Param(value = "activityName") String activityName);

    /*
    查询活动条数
     */
    int selectCount(@Param("activityName")String activityName);
    /*
    修改活动地址和活动名称
     */
    int updateActivity(@Param(value = "activityName") String activityName,
                      @Param(value = "activityPhoto") String activityPhoto,
                      @Param(value = "id") int id);
    /*
    基于id删除活动
     */
    int delete(int id);
    /*
   查询所有的活动内容个数
    */
    int selectContentCount(@Param("theme") String theme);
    /*
   添加活动
    */
    int insertActivity(@Param(value = "activityName") String activityName,
                       @Param(value = "activityPhoto") String activityPhoto);
    /*
    查询活动内容
     */
    List<ActivityContent> selectByTheme(@Param(value = "pageSize") int pageSize,
                                        @Param(value = "index") int index,
                                        @Param(value = "theme") String theme);

    /*
    添加活动内容
     */
    int insertById( @Param(value = "id") int id,
                    @Param(value = "theme") String theme,
                    @Param(value = "time") String time,
                    @Param(value = "content") String content);
    /*
    基于id删除活动内容
     */
    int deleteById(int id);

    /*
    修改活动内容
     */
    int updateContent(@Param(value = "id") int id,
                      @Param(value = "theme") String theme,
                      @Param(value = "time") String time,
                      @Param(value = "content") String content);
}
